package com.nbsaas.boot.order.rest.resource;

import com.nbsaas.boot.order.api.apis.OrderLogisticsApi;
import com.nbsaas.boot.order.data.entity.OrderLogistics;
import com.nbsaas.boot.order.api.domain.request.OrderLogisticsRequest;
import com.nbsaas.boot.order.api.domain.response.OrderLogisticsResponse;
import com.nbsaas.boot.order.api.domain.simple.OrderLogisticsSimple;
import com.nbsaas.boot.order.rest.convert.OrderLogisticsSimpleConvert;
import com.nbsaas.boot.order.rest.convert.OrderLogisticsEntityConvert;
import com.nbsaas.boot.order.rest.convert.OrderLogisticsResponseConvert;
import com.nbsaas.boot.order.data.repository.OrderLogisticsRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import jakarta.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   订单物流-业务接口实现
*/
@Transactional
@Service
public class OrderLogisticsResource extends BaseResource<OrderLogistics,OrderLogisticsResponse, OrderLogisticsSimple, OrderLogisticsRequest>  implements OrderLogisticsApi {

    @Resource
    private OrderLogisticsRepository orderLogisticsRepository;

    @Override
    public JpaRepositoryImplementation<OrderLogistics, Serializable> getJpaRepository() {
        return orderLogisticsRepository;
    }

    @Override
    public Function<OrderLogistics, OrderLogisticsSimple> getConvertSimple() {
        return new OrderLogisticsSimpleConvert();
    }

    @Override
    public Function<OrderLogisticsRequest, OrderLogistics> getConvertForm() {
        return new OrderLogisticsEntityConvert();
    }

    @Override
    public Function<OrderLogistics, OrderLogisticsResponse> getConvertResponse() {
        return new OrderLogisticsResponseConvert();
    }




}


